<!DOCTYPE html>
<html lang="en" ng-app="myApp">

<head>
    <meta charset="UTF-8">
    <script src="https://cdn.bootcss.com/angular.js/1.6.4/angular.min.js"></script>
    <title>为什么使用在DOM中使用点符号操作scope对象</title>
</head>

<body>
    <div ng-controller="parentController">
        <input ng-model="salary"> {{salary}}
        <div ng-controller="sonController">
            <input ng-model="salary"> {{salary}}
        </div>
        <div ng-controller="daughterController">
            <input ng-model="salary"> {{salary}}
        </div>
    </div>
   <div ng-controller="parentController2">
        <input ng-model="job.salary"> {{job.salary}}
        <div ng-controller="sonController2">
            <input ng-model="job.salary"> {{job.salary}}
        </div>
        <div ng-controller="daughterController2">
            <input ng-model="job.salary"> {{job.salary}}
        </div>
    </div>
    <script type="text/javascript">
    var app = angular.module("myApp", []);
    app.controller("parentController", function($scope) {
        $scope.salary = "15000"
    }).controller("sonController", function($scope) {
    }).controller("daughterController", function($scope) {
        
    })

    app.controller("parentController2", function($scope) {
        $scope.job = {
            salary: "15000"
        }
    }).controller("sonController2", function($scope) {
       

    }).controller("daughterController2", function($scope) {

        
    })
    </script>
</body>

</html>
